Commit df61c152 authored by MagoKimbra's avatar MagoKimbra

Update

parent 4af24b14
......@@ -2,7 +2,6 @@
#define CONFIGURATION_H
#include "boards.h"
#include "macros.h"
//===========================================================================
//============================= Getting Started =============================
......@@ -65,13 +64,13 @@
/***********************************************************************\
********************** Do not touch this section **********************
***********************************************************************/
#if ENABLED(CARTESIAN)
#if defined(CARTESIAN)
#include "Configuration_Cartesian.h"
#elif ENABLED(COREXY)
#elif defined(COREXY)
#include "Configuration_Corexy.h"
#elif ENABLED(DELTA)
#elif defined(DELTA)
#include "Configuration_Delta.h"
#elif ENABLED(SCARA)
#elif defined(SCARA)
#include "Configuration_Scara.h"
#endif
/***********************************************************************/
......@@ -603,7 +602,7 @@
//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
// It is assumed that when logic high = filament available
// when logic low = filament run out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#ifdef FILAMENT_RUNOUT_SENSOR
const bool FILRUNOUT_PIN_INVERTING = true; // Should be uncommented and true or false should assigned
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600" // Script execute when filament run out
......
......@@ -9,7 +9,7 @@
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#if DISABLED(ENDSTOPPULLUPS)
#ifndef ENDSTOPPULLUPS
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
......@@ -76,10 +76,10 @@
#define E_MIN_POS 0
//=====================================================================================
//============================= Bed Manual or Auto Leveling ===========================
//================ Manual Bed Leveling (MBL) or Auto Bed Leveling =====================
//=====================================================================================
// set the rectangle in which to probe in manual or automatic
// set the rectangle in which to probe in MBL or ABL
#define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
......@@ -90,7 +90,7 @@
//If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING)
#ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z
#endif
......@@ -98,7 +98,7 @@
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to specify probing locations
//
......@@ -176,7 +176,7 @@
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations:
#if ENABLED(MANUAL_HOME_POSITIONS)
#ifdef MANUAL_HOME_POSITIONS
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0
......@@ -210,7 +210,7 @@
// Custom M code points
//#define CUSTOM_M_CODES
#if ENABLED(CUSTOM_M_CODES)
#ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
......
......@@ -9,7 +9,7 @@
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#if DISABLED(ENDSTOPPULLUPS)
#ifndef ENDSTOPPULLUPS
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
......@@ -90,7 +90,7 @@
//If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING)
#ifndef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z
#endif
......@@ -98,7 +98,7 @@
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to specify probing locations
//
......@@ -115,7 +115,7 @@
// Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID
#if ENABLED(AUTO_BED_LEVELING_GRID)
#ifdef AUTO_BED_LEVELING_GRID
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
......@@ -176,7 +176,7 @@
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations:
#if ENABLED(MANUAL_HOME_POSITIONS)
#ifdef MANUAL_HOME_POSITIONS
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0
......@@ -210,7 +210,7 @@
// Custom M code points
//#define CUSTOM_M_CODES
#if ENABLED(CUSTOM_M_CODES)
#ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
......
......@@ -56,7 +56,7 @@
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#if DISABLED(ENDSTOPPULLUPS)
#ifndef ENDSTOPPULLUPS
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
......
......@@ -17,7 +17,7 @@
//=============================Thermal Settings ============================
//===========================================================================
#if ENABLED(BED_LIMIT_SWITCHING)
#ifdef BED_LIMIT_SWITCHING
#define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
#endif
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
......@@ -25,7 +25,7 @@
/**
* Thermal Protection parameters
*/
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#ifdef THERMAL_PROTECTION_HOTENDS
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
......@@ -39,7 +39,7 @@
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif
#if ENABLED(THERMAL_PROTECTION_BED)
#ifdef THERMAL_PROTECTION_BED
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif
......@@ -56,7 +56,7 @@
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/
#define AUTOTEMP
#if ENABLED(AUTOTEMP)
#ifdef AUTOTEMP
#define AUTOTEMP_OLDWEIGHT 0.98
#endif
......@@ -135,7 +135,7 @@
// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#ifdef Z_DUAL_STEPPER_DRIVERS
// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
// That way the machine is capable to align the bed during home, since both Z steppers are homed.
......@@ -148,7 +148,7 @@
#define Z_DUAL_ENDSTOPS
#if ENABLED(Z_DUAL_ENDSTOPS)
#ifdef Z_DUAL_ENDSTOPS
#define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis.
#define Z2_DIR_PIN E2_DIR_PIN
#define Z2_ENABLE_PIN E2_ENABLE_PIN
......@@ -170,7 +170,7 @@
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
// allowing faster printing speeds.
//#define DUAL_X_CARRIAGE
#if ENABLED(DUAL_X_CARRIAGE)
#ifdef DUAL_X_CARRIAGE
// Configuration for second X-carriage
// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
// the second x-carriage always homes to the maximum endstop.
......@@ -236,7 +236,7 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0
#if ENABLED(ULTIPANEL)
#ifdef ULTIPANEL
#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
#define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder
#endif
......@@ -305,7 +305,7 @@
// Show a progress bar on HD44780 LCDs for SD printing
//#define LCD_PROGRESS_BAR
#if ENABLED(LCD_PROGRESS_BAR)
#ifdef LCD_PROGRESS_BAR
// Amount of time (ms) to show the bar
#define PROGRESS_BAR_BAR_TIME 5000
// Amount of time (ms) to show the status message
......@@ -322,7 +322,7 @@
#endif // SDSUPPORT
// for dogm lcd displays you can choose some additional fonts:
#if ENABLED(DOGLCD)
#ifdef DOGLCD
// save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
// we don't have a big font for Cyrillic, Kana
//#define USE_BIG_EDIT_FONT
......@@ -335,7 +335,7 @@
// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
//#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
#ifdef USE_WATCHDOG
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
......@@ -349,7 +349,7 @@
// it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops!
//#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
#ifdef BABYSTEPPING
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
#define BABYSTEP_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
......@@ -364,7 +364,7 @@
// so: v ^ 2 is proportional to number of steps we advance the extruder
//#define ADVANCE
#if ENABLED(ADVANCE)
#ifdef ADVANCE
#define EXTRUDER_ADVANCE_K .0
#define D_FILAMENT 2.85
#define STEPS_MM_E 836
......@@ -385,7 +385,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
// The number of linear motions that can be in the plan at any give time.
// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
#if ENABLED(SDSUPPORT)
#ifdef SDSUPPORT
#define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
......@@ -412,7 +412,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
// the moves are than replaced by the firmware controlled ones.
//#define FWRETRACT //ONLY PARTIALLY TESTED
#if ENABLED(FWRETRACT)
#ifdef FWRETRACT
#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
#define RETRACT_LENGTH 3 //default retract length (positive mm)
#define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change
......@@ -424,9 +424,9 @@ const unsigned int dropsegments = 5; // everything with less than this number of
#endif
// Add support for filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
#ifdef ULTIPANEL
#define FILAMENTCHANGEENABLE
#if ENABLED(FILAMENTCHANGEENABLE)
#ifdef FILAMENTCHANGEENABLE
#define FILAMENTCHANGE_XPOS 3
#define FILAMENTCHANGE_YPOS 3
#define FILAMENTCHANGE_ZADD 10
......@@ -442,7 +442,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
******************************************************************************/
//#define HAVE_TMCDRIVER
#if ENABLED(HAVE_TMCDRIVER)
#ifdef HAVE_TMCDRIVER
// #define X_IS_TMC
#define X_MAX_CURRENT 1000 //in mA
......@@ -502,7 +502,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
******************************************************************************/
//#define HAVE_L6470DRIVER
#if ENABLED(HAVE_L6470DRIVER)
#ifdef HAVE_L6470DRIVER
// #define X_IS_L6470
#define X_MICROSTEPS 16 //number of microsteps
......
......@@ -35,6 +35,22 @@
#include "WProgram.h"
#endif
// Macros for bit masks
#define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0)
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
// Macros for maths shortcuts
#define M_PI 3.1415926536
#define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((r)*180.0/M_PI)
#define SIN_60 0.8660254037844386
#define COS_60 0.5
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)
typedef unsigned long millis_t;
// Arduino < 1.0.0 does not define this, so we need to do it ourselves
......@@ -50,7 +66,7 @@ void idle(bool ignore_stepper_queue = false);
void manage_inactivity(bool ignore_stepper_queue=false);
#if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
#if defined(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
#define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
#define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
#elif HAS_X_ENABLE
......@@ -62,7 +78,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#endif
#if HAS_Y_ENABLE
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#ifdef Y_DUAL_STEPPER_DRIVERS
#define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#else
......@@ -75,7 +91,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#endif
#if HAS_Z_ENABLE
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#ifdef Z_DUAL_STEPPER_DRIVERS
#define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#else
......@@ -142,25 +158,25 @@ void disable_all_steppers();
void FlushSerialRequestResend();
void ok_to_send();
#if ENABLED(DELTA)
float probe_bed(float x, float y);
void set_delta_constants();
void home_delta_axis();
void calibration_report();
void bed_probe_all();
void set_default_z_probe_offset();
void set_delta_constants();
void save_carriage_positions(int position_num);
void calculate_delta(float cartesian[3]);
void adjust_delta(float cartesian[3]);
void prepare_move_raw();
extern float delta[3];
extern float delta_tmp[3];
extern float delta_tower1_x, delta_tower1_y;
extern float delta_tower2_x, delta_tower2_y;
extern float delta_tower3_x, delta_tower3_y;
#ifdef DELTA
float probe_bed(float x, float y);
void set_delta_constants();
void home_delta_axis();
void calibration_report();
void bed_probe_all();
void set_default_z_probe_offset();
void set_delta_constants();
void save_carriage_positions(int position_num);
void calculate_delta(float cartesian[3]);
void adjust_delta(float cartesian[3]);
void prepare_move_raw();
extern float delta[3];
extern float delta_tmp[3];
extern float delta_tower1_x, delta_tower1_y;
extern float delta_tower2_x, delta_tower2_y;
extern float delta_tower3_x, delta_tower3_y;
#endif
#if ENABLED(SCARA)
#ifdef SCARA
void calculate_delta(float cartesian[3]);
void calculate_SCARA_forward_Transform(float f_scara[3]);
#endif
......@@ -168,7 +184,7 @@ void prepare_move();
void kill(const char *);
void Stop();
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#ifdef FILAMENT_RUNOUT_SENSOR
void filrunout();
#endif
......@@ -197,7 +213,7 @@ void clamp_to_software_endstops(float target[3]);
extern millis_t previous_cmd_ms;
inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
#if ENABLED(FAST_PWM_FAN)
#ifdef FAST_PWM_FAN
void setPwmFrequency(uint8_t pin, int val);
#endif
......@@ -227,22 +243,22 @@ extern float home_offset[3];
extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
#endif // HOTENDS > 1
#if ENABLED(NPR2)
#ifdef NPR2
extern int old_color; // old color for system NPR2
#endif
#if ENABLED(DELTA)
#ifdef DELTA
extern float z_probe_offset[3];
extern float endstop_adj[3];
extern float tower_adj[6];
extern float delta_radius;
extern float delta_diagonal_rod;
extern float delta_segments_per_second;
#elif ENABLED(Z_DUAL_ENDSTOPS)
#elif defined(Z_DUAL_ENDSTOPS)
extern float z_endstop_adj;
#endif
#if ENABLED(SCARA)
#ifdef SCARA
extern float axis_scaling[3]; // Build size scaling
#endif
......@@ -255,18 +271,18 @@ extern float zprobe_zoffset;
// Lifetime stats
extern unsigned long printer_usage_seconds; //this can old about 136 year before go overflow. If you belive that you can live more than this please contact me.
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
#ifdef PREVENT_DANGEROUS_EXTRUDE
extern float extrude_min_temp;
#endif
extern int fanSpeed;
#if ENABLED(BARICUDA)
#ifdef BARICUDA
extern int ValvePressure;
extern int EtoPPressure;
#endif
#if ENABLED(FAN_SOFT_PWM)
#ifdef FAN_SOFT_PWM
extern unsigned char fanSpeedSoftPwm;
#endif
......@@ -287,26 +303,26 @@ extern int fanSpeed;
extern unsigned long stoppower;
#endif
#if ENABLED(IDLE_OOZING_PREVENT)
#ifdef IDLE_OOZING_PREVENT
extern bool idleoozing_enabled;
#endif
#if ENABLED(FWRETRACT)
#ifdef FWRETRACT
extern bool autoretract_enabled;
extern bool retracted[EXTRUDERS];
extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
#endif
#if ENABLED(EASY_LOAD)
#ifdef EASY_LOAD
extern bool allow_lengthy_extrude_once; // for load/unload
#endif
#if ENABLED(LASERBEAM)
#ifdef LASERBEAM
extern int laser_ttl_modulation;
#endif
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
#if defined(SDSUPPORT) && defined(SD_SETTINGS)
extern millis_t config_last_update;
extern bool config_readed;
#endif
......@@ -318,12 +334,12 @@ extern millis_t print_job_stop_ms;
extern uint8_t active_extruder;
extern uint8_t active_driver;
#if ENABLED(DIGIPOT_I2C)
#ifdef DIGIPOT_I2C
extern void digipot_i2c_set_current( int channel, float current );
extern void digipot_i2c_init();
#endif
#if ENABLED(FIRMWARE_TEST)
#ifdef FIRMWARE_TEST
void FirmwareTest();
#endif
......
......@@ -287,6 +287,6 @@ MarlinSerial MSerial;
#endif // !AT90USB
// For AT90USB targets use the UART for BT interfacing
#if defined(AT90USB) && ENABLED(BTENABLED)
#if defined(AT90USB) && defined(BTENABLED)
HardwareSerial bt;
#endif
......@@ -153,7 +153,7 @@ extern MarlinSerial MSerial;
#endif // !AT90USB
// Use the UART for BT in AT90USB configurations
#if defined(AT90USB) && ENABLED(BTENABLED)
#if defined(AT90USB) && defined(BTENABLED)
extern HardwareSerial bt;
#endif
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
Created by Tim Koster, August 21 2013.
*/
#include "Marlin.h"
#if ENABLED(BLINKM)
#ifdef BLINKM
#include "blinkm.h"
......
......@@ -5,7 +5,7 @@
#include "temperature.h"
#include "language.h"
#if ENABLED(SDSUPPORT)
#ifdef SDSUPPORT
CardReader::CardReader() {
filesize = 0;
......@@ -126,7 +126,7 @@ void CardReader::ls() {
lsDive("", root);
}
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
#ifdef LONG_FILENAME_HOST_SUPPORT
/**
* Get a long pretty path based on a DOS 8.3 path
......@@ -191,7 +191,7 @@ void CardReader::initsd() {
cardOK = false;
if (root.isOpen()) root.close();
#if ENABLED(SDSLOW)
#ifdef SDSLOW
#define SPI_SPEED SPI_HALF_SPEED
#else
#define SPI_SPEED SPI_FULL_SPEED
......@@ -202,7 +202,7 @@ void CardReader::initsd() {
&& !card.init(SPI_SPEED, LCD_SDSS)
#endif
) {
ECHO_LM(ER, MSG_SD_INIT_FAIL);
ECHO_LM(DB, MSG_SD_INIT_FAIL);
}
else if (!volume.init(&card)) {
ECHO_LM(ER, MSG_SD_VOL_INIT_FAIL);
......@@ -212,7 +212,7 @@ void CardReader::initsd() {
}
else {
cardOK = true;
ECHO_LM(OK, MSG_SD_CARD_OK);
ECHO_LM(DB, MSG_SD_CARD_OK);
}
workDir = root;
curDir = &root;
......@@ -264,7 +264,7 @@ void CardReader::getAbsFilename(char *t) {
t[0] = 0;
}
void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, bool lcd_status/*=true*/) {
void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) {
if (!cardOK) return;
if (file.isOpen()) { //replacing current file by new file, or subfile call
if (!replace_current) {
......@@ -357,7 +357,6 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
else {
saving = true;
ECHO_EMV(MSG_SD_WRITE_TO_FILE, name);
lcd_setstatus(fname);
}
}
}
......@@ -383,7 +382,8 @@ void CardReader::removeFile(char* name) {
subdirname[dirname_end - dirname_start] = 0;
ECHO_EV(subdirname);
if (!myDir.open(curDir, subdirname, O_READ)) {
ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL, subdirname);
ECHO_MV(MSG_SD_OPEN_FILE_FAIL, subdirname);
ECHO_C('.');
return;
}
......@@ -401,21 +401,22 @@ void CardReader::removeFile(char* name) {
}
if (file.remove(curDir, fname)) {
ECHO_LMV(OK, MSG_SD_FILE_DELETED, fname);
ECHO_EMV(MSG_SD_FILE_DELETED, fname);
sdpos = 0;
}
else {
ECHO_LMV(ER, MSG_SD_FILE_DELETION_ERR, fname);
ECHO_MV(MSG_SD_FILE_DELETION_ERR, fname);
ECHO_C('.');
}
}
void CardReader::getStatus() {
if (cardOK) {
ECHO_SMV(OK, MSG_SD_PRINTING_BYTE, sdpos);
ECHO_MV(MSG_SD_PRINTING_BYTE, sdpos);
ECHO_EMV(MSG_SD_SLASH, filesize);
}
else {
ECHO_LM(OK, MSG_SD_NOT_PRINTING);
ECHO_EM(MSG_SD_NOT_PRINTING);
}
}
......
#ifndef CARDREADER_H
#define CARDREADER_H
#if ENABLED(SDSUPPORT)
#ifdef SDSUPPORT
#define MAX_DIR_DEPTH 10 // Maximum folder depth
......@@ -18,7 +18,7 @@ public:
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
void checkautostart(bool x);
void openFile(char* name, bool read, bool replace_current = true, bool lcd_status = true);
void openFile(char* name,bool read,bool replace_current=true);
void openLogFile(char* name);
void removeFile(char* name);
void closeFile(bool store_location = false);
......@@ -30,7 +30,7 @@ public:
void getStatus();
void printingHasFinished();
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
#ifdef LONG_FILENAME_HOST_SUPPORT
void printLongPath(char *path);
#endif
......@@ -84,7 +84,7 @@ extern CardReader card;
#define IS_SD_PRINTING (card.sdprinting)
#if (SDCARDDETECT > -1)
#if ENABLED(SDCARDDETECTINVERTED)
#ifdef SDCARDDETECTINVERTED
#define IS_SD_INSERTED (READ(SDCARDDETECT) != 0)
#else
#define IS_SD_INSERTED (READ(SDCARDDETECT) == 0)
......
/**
* Comunication.h - serial messages functions
* Part of Marlin
* Part of MarlinKimbra
*
* Author: Simone Primarosa
*/
......@@ -40,7 +40,7 @@
#endif
#define START "start" //start for host
#define OK "ok" //ok answer for host
#define OK "ok " //ok answer for host
#define ER "Error: " //error for host
#define WT "wait" //wait for host
#define DB "echo: " //message for user
......@@ -54,9 +54,13 @@
#define SERIAL_PRINT(msg, args...) MYSERIAL.print(msg, ##args)
#define SERIAL_ENDL MYSERIAL.println()
// Things to write to serial from Program memory. Saves 400 to 2k of RAM.
FORCE_INLINE void PS_PGM(const char *str) {
char ch;
while ((ch = pgm_read_byte(str++))) { SERIAL_WRITE(ch); }
while ((ch = pgm_read_byte(str))) {
MYSERIAL.write(ch);
str++;
}
}
#define ECHO_ENDL SERIAL_ENDL
......@@ -65,8 +69,8 @@ FORCE_INLINE void PS_PGM(const char *str) {
#define ECHO_MV(msg, val, args...) ECHO_PGM(msg),ECHO_V(val, ##args)
#define ECHO_VM(val, msg, args...) ECHO_V(val, ##args),ECHO_PGM(msg)
#define ECHO_M(msg) ECHO_PGM(msg)
#define ECHO_V SERIAL_PRINT
#define ECHO_C SERIAL_WRITE
#define ECHO_V(msg, args...) SERIAL_PRINT(msg, ##args)
#define ECHO_C(x) SERIAL_WRITE(x)
#define ECHO_S(srt) ECHO_PGM(srt)
#define ECHO_SM(srt, msg) ECHO_S(srt),ECHO_M(msg)
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,7 +6,7 @@
void Config_ResetDefault();
void ConfigSD_ResetDefault();
#if DISABLED(DISABLE_M503)
#ifndef DISABLE_M503
void Config_PrintSettings(bool forReplay = false);
void ConfigSD_PrintSettings(bool forReplay = false);
#else
......@@ -22,7 +22,7 @@ void ConfigSD_ResetDefault();
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endif
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
#if defined(SDSUPPORT) && defined(SD_SETTINGS)
static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#ifdef POWER_CONSUMPTION
"PWR",
......
......@@ -3,7 +3,7 @@
// Please note that using the high-res version takes 402Bytes of PROGMEM.
//#define START_BMPHIGH
#if ENABLED(START_BMPHIGH)
#ifdef START_BMPHIGH
#define START_BMPWIDTH 112
#define START_BMPHEIGHT 38
#define START_BMPBYTEWIDTH 14
......
......@@ -18,7 +18,7 @@
* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
*/
#if ENABLED(ULTIPANEL)
#ifdef ULTIPANEL
#define BLEN_A 0
#define BLEN_B 1
#define BLEN_C 2
......@@ -35,12 +35,12 @@
#include "ultralcd_st7920_u8glib_rrd.h"
#include "Configuration.h"
#if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT)
#if defined(MAPPER_C2C3) && defined(MAPPER_NON) && defined(USE_BIG_EDIT_FONT)
#undef USE_BIG_EDIT_FONT
#endif
#if ENABLED(USE_SMALL_INFOFONT)
#ifdef USE_SMALL_INFOFONT
#include "dogm_font_data_6x9_marlin.h"
#define FONT_STATUSMENU_NAME u8g_font_6x9
#else
......@@ -50,17 +50,17 @@
#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols
#define FONT_SPECIAL_NAME Marlin_symbols
#if DISABLED(SIMULATE_ROMFONT)
#if ENABLED(DISPLAY_CHARSET_ISO10646_1)
#ifndef SIMULATE_ROMFONT
#if defined( DISPLAY_CHARSET_ISO10646_1 )
#include "dogm_font_data_ISO10646_1.h"
#define FONT_MENU_NAME ISO10646_1_5x7
#elif ENABLED(DISPLAY_CHARSET_ISO10646_5)
#elif defined( DISPLAY_CHARSET_ISO10646_5 )
#include "dogm_font_data_ISO10646_5_Cyrillic.h"
#define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7
#elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
#elif defined( DISPLAY_CHARSET_ISO10646_KANA )
#include "dogm_font_data_ISO10646_Kana.h"
#define FONT_MENU_NAME ISO10646_Kana_5x7
#elif ENABLED(DISPLAY_CHARSET_ISO10646_CN)
#elif defined( DISPLAY_CHARSET_ISO10646_CN )
#include "dogm_font_data_ISO10646_CN.h"
#define FONT_MENU_NAME ISO10646_CN
#define TALL_FONT_CORRECTION 1
......@@ -69,13 +69,13 @@
#define FONT_MENU_NAME ISO10646_1_5x7
#endif
#else // SIMULATE_ROMFONT
#if ENABLED(DISPLAY_CHARSET_HD44780_JAPAN)
#if defined( DISPLAY_CHARSET_HD44780_JAPAN )
#include "dogm_font_data_HD44780_J.h"
#define FONT_MENU_NAME HD44780_J_5x7
#elif ENABLED(DISPLAY_CHARSET_HD44780_WESTERN)
#elif defined( DISPLAY_CHARSET_HD44780_WESTERN )
#include "dogm_font_data_HD44780_W.h"
#define FONT_MENU_NAME HD44780_W_5x7
#elif ENABLED(DISPLAY_CHARSET_HD44780_CYRILLIC)
#elif defined( DISPLAY_CHARSET_HD44780_CYRILLIC )
#include "dogm_font_data_HD44780_C.h"
#define FONT_MENU_NAME HD44780_C_5x7
#else // fall-back
......@@ -94,7 +94,7 @@
// DOGM parameters (size in pixels)
#define DOG_CHAR_WIDTH 6
#define DOG_CHAR_HEIGHT 12
#if ENABLED(USE_BIG_EDIT_FONT)
#ifdef USE_BIG_EDIT_FONT
#define FONT_MENU_EDIT_NAME u8g_font_9x18
#define DOG_CHAR_WIDTH_EDIT 9
#define DOG_CHAR_HEIGHT_EDIT 18
......@@ -113,16 +113,16 @@
#define START_ROW 0
// LCD selection
#if ENABLED(U8GLIB_ST7920)
#ifdef U8GLIB_ST7920
//U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
U8GLIB_ST7920_128X64_RRD u8g(0);
#elif ENABLED(MAKRPANEL)
#elif defined(MAKRPANEL)
// The MaKrPanel display, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#elif ENABLED(VIKI2) || ENABLED(miniVIKI)
#elif defined(VIKI2) || defined(miniVIKI)
// Mini Viki and Viki 2.0 LCD, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#elif ENABLED(U8GLIB_LM6059_AF)
#elif defined(U8GLIB_LM6059_AF)
// Based on the Adafruit ST7565 (http://www.adafruit.com/products/250)
U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
#else
......@@ -189,7 +189,7 @@ static bool show_splashscreen = true;
/* Warning: This function is called from interrupt context */
static void lcd_implementation_init() {
#if ENABLED(LCD_PIN_BL) // Enable LCD backlight
#ifdef LCD_PIN_BL // Enable LCD backlight
pinMode(LCD_PIN_BL, OUTPUT);
digitalWrite(LCD_PIN_BL, HIGH);
#endif
......@@ -200,17 +200,17 @@ static void lcd_implementation_init() {
// pinMode(17, OUTPUT); // Enable LCD backlight
// digitalWrite(17, HIGH);
#if ENABLED(LCD_SCREEN_ROT_90)
#ifdef LCD_SCREEN_ROT_90
u8g.setRot90(); // Rotate screen by 90°
#elif ENABLED(LCD_SCREEN_ROT_180)
#elif defined(LCD_SCREEN_ROT_180)
u8g.setRot180(); // Rotate screen by 180°
#elif ENABLED(LCD_SCREEN_ROT_270)
#elif defined(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270°
#endif
// Show splashscreen
int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
#if ENABLED(START_BMPHIGH)
#ifdef START_BMPHIGH
int offy = 0;
#else
int offy = DOG_CHAR_HEIGHT;
......@@ -265,7 +265,7 @@ static void lcd_implementation_status_screen() {
// Symbols menu graphics, animated fan
u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
#if ENABLED(SDSUPPORT)
#ifdef SDSUPPORT
// SD Card Symbol
u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7);
u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5);
......@@ -333,7 +333,7 @@ static void lcd_implementation_status_screen() {
#define XYZ_BASELINE 38
lcd_setFont(FONT_STATUSMENU);
#if ENABLED(USE_SMALL_INFOFONT)
#ifdef USE_SMALL_INFOFONT
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10);
#else
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9);
......@@ -344,28 +344,19 @@ static void lcd_implementation_status_screen() {
u8g.drawPixel(8,XYZ_BASELINE - 5);
u8g.drawPixel(8,XYZ_BASELINE - 3);
u8g.setPrintPos(10,XYZ_BASELINE);
if (axis_known_position[X_AXIS])
lcd_print(ftostr31ns(current_position[X_AXIS]));
else
lcd_printPGM(PSTR("---"));
u8g.setPrintPos(43,XYZ_BASELINE);
lcd_print('Y');
u8g.drawPixel(49,XYZ_BASELINE - 5);
u8g.drawPixel(49,XYZ_BASELINE - 3);
u8g.setPrintPos(51,XYZ_BASELINE);
if (axis_known_position[Y_AXIS])
lcd_print(ftostr31ns(current_position[Y_AXIS]));
else
lcd_printPGM(PSTR("---"));
u8g.setPrintPos(83,XYZ_BASELINE);
lcd_print('Z');
u8g.drawPixel(89,XYZ_BASELINE - 5);
u8g.drawPixel(89,XYZ_BASELINE - 3);
u8g.setPrintPos(91,XYZ_BASELINE);
if (axis_known_position[Z_AXIS])
lcd_print(ftostr32sp(current_position[Z_AXIS]));
else
lcd_printPGM(PSTR("---.--"));
lcd_print(ftostr31(current_position[Z_AXIS]));
u8g.setColorIndex(1); // black on white
// Feedrate
......@@ -379,7 +370,7 @@ static void lcd_implementation_status_screen() {
// Status line
lcd_setFont(FONT_STATUSMENU);
#if ENABLED(USE_SMALL_INFOFONT)
#ifdef USE_SMALL_INFOFONT
u8g.setPrintPos(0,62);
#else
u8g.setPrintPos(0,63);
......@@ -491,7 +482,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
uint8_t vallen = lcd_strlen(value);
#if ENABLED(USE_BIG_EDIT_FONT)
#ifdef USE_BIG_EDIT_FONT
if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
lcd_setFont(FONT_MENU_EDIT);
lcd_width = LCD_WIDTH_EDIT + 1;
......
......@@ -197,9 +197,9 @@
#define MSG_KP " Kp: "
#define MSG_KI " Ki: "
#define MSG_KD " Kd: "
#define MSG_B " B:"
#define MSG_T " T:"
#define MSG_AT " @:"
#define MSG_T "T:"
#define MSG_B "B:"
#define MSG_AT "@:"
#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h or send command M500 for save in EEPROM the new value!"
#define MSG_PID_DEBUG " PID_DEBUG "
#define MSG_PID_DEBUG_INPUT ": Input "
......@@ -232,7 +232,8 @@
#define MSG_BED_LEVELLING_Z " Z: "
// LCD Menu Messages
#if !(ENABLED(DISPLAY_CHARSET_HD44780_JAPAN) || ENABLED(DISPLAY_CHARSET_HD44780_WESTERN) || ENABLED(DISPLAY_CHARSET_HD44780_CYRILLIC))
#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC ))
#define DISPLAY_CHARSET_HD44780_JAPAN
#endif
......
......@@ -24,14 +24,15 @@
#define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Disable steppers"
#define MSG_AUTO_HOME "Auto home"
#define MSG_BED_SETTING "Bed Setting"
#define MSG_LP_INTRO " Leveling bed... Press to start "
#define MSG_LP_1 " Adjust first point & Press the button"
#define MSG_LP_2 " Adjust second point & Press the button"
#define MSG_LP_3 " Adjust third point & Press the button"
#define MSG_LP_4 " Adjust fourth point & Press the button"
#define MSG_LP_5 " Is it ok? Press to end"
#define MSG_LP_6 " BED leveled!"
#define MSG_MBL_SETTING "Manual Bed Leveling"
#define MSG_MBL_BUTTON " Press the button "
#define MSG_MBL_INTRO " Leveling bed... "
#define MSG_MBL_1 " Adjust first point "
#define MSG_MBL_2 " Adjust second point"
#define MSG_MBL_3 " Adjust third point "
#define MSG_MBL_4 " Adjust fourth point"
#define MSG_MBL_5 " Is it ok? "
#define MSG_MBL_6 " BED leveled! "
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Set origin"
#define MSG_PREHEAT_PLA "Preheat PLA"
......
......@@ -24,14 +24,15 @@
#define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Disabilita Motori"
#define MSG_AUTO_HOME "Auto Home"
#define MSG_BED_SETTING "Bed Setting"
#define MSG_LP_INTRO " Leveling bed... Press to start "
#define MSG_LP_1 " Adjust first point & Press the button"
#define MSG_LP_2 " Adjust second point & Press the button"
#define MSG_LP_3 " Adjust third point & Press the button"
#define MSG_LP_4 " Adjust fourth point & Press the button"
#define MSG_LP_5 " Is it ok? Press to end"
#define MSG_LP_6 " BED leveled!"
#define MSG_MBL_SETTING "Manual Bed Leveling "
#define MSG_MBL_BUTTON " Press the button "
#define MSG_MBL_INTRO " Leveling bed... "
#define MSG_MBL_1 " Adjust first point "
#define MSG_MBL_2 " Adjust second point"
#define MSG_MBL_3 " Adjust third point "
#define MSG_MBL_4 " Adjust fourth point"
#define MSG_MBL_5 " Is it ok? "
#define MSG_MBL_6 " BED leveled! "
#define MSG_SET_HOME_OFFSETS "Setta offset home"
#define MSG_SET_ORIGIN "Imposta Origine"
#define MSG_PREHEAT_PLA "Preriscalda PLA"
......
#ifndef MACROS_H
#define MACROS_H
// Macros for bit masks
#define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0)
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
// Macros for maths shortcuts
#define M_PI 3.1415926536
#define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((r)*180.0/M_PI)
#define SIN_60 0.8660254037844386
#define COS_60 0.5
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)
// Macros to support option testing
#define _CAT(a, ...) a ## __VA_ARGS__
#define SWITCH_ENABLED_0 0
#define SWITCH_ENABLED_1 1
#define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
// Macros for check PIN
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
/**
* Shorthand for pin tests, used wherever needed
*/
#define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)
#define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0)
#define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0)
#define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0)
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0)
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
#define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
#define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
#define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
#define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
#define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN))
#define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN))
#define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN))
#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
#define HAS_FAN (PIN_EXISTS(FAN))
#define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
#define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
#define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
#define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
#define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
#define HAS_FILAMENT_SENSOR (ENABLED(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
#define HAS_POWER_CONSUMPTION_SENSOR (ENABLED(POWER_CONSUMPTION) && PIN_EXISTS(POWER_CONSUMPTION))
#define HAS_FILRUNOUT (ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FILRUNOUT))
#define HAS_HOME (PIN_EXISTS(HOME))
#define HAS_KILL (PIN_EXISTS(KILL))
#define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
#define HAS_X_MIN (PIN_EXISTS(X_MIN))
#define HAS_X_MAX (PIN_EXISTS(X_MAX))
#define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
#define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
#define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
#define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
#define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE))
#define HAS_E_MIN (PIN_EXISTS(E_MIN))
#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
#define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
#define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
#define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
#define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
#define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
#define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
#define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
#define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
#define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
#define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
#define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
#define HAS_X_DIR (PIN_EXISTS(X_DIR))
#define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
#define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
#define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
#define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
#define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
#define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
#define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
#define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
#define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
#define HAS_X_STEP (PIN_EXISTS(X_STEP))
#define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
#define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
#define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
#define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
#define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
#define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
#define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
#define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
#define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
#define HAS_E0E1 (PIN_EXISTS(E0E1_CHOICE))
#define HAS_E0E2 (PIN_EXISTS(E0E2_CHOICE))
#define HAS_E0E3 (PIN_EXISTS(E0E3_CHOICE))
#define HAS_E0E4 (PIN_EXISTS(E0E4_CHOICE))
#define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE))
#define HAS_BTN_BACK (PIN_EXISTS(BTN_BACK))
/**
* Shorthand for filament sensor and power sensor for ultralcd.cpp, dogm_lcd_implementation.h, ultralcd_implementation_hitachi_HD44780.h
*/
#define HAS_LCD_FILAMENT_SENSOR (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY))
#define HAS_LCD_POWER_SENSOR (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY))
#endif //__MACROS_H
......@@ -4909,7 +4909,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
********************************* END MOTHERBOARD ***************************************
/****************************************************************************************/
#if DISABLED(KNOWN_BOARD)
#ifndef KNOWN_BOARD
#error Unknown MOTHERBOARD value in configuration.h
#endif
......@@ -4980,35 +4980,35 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define Z_MAX_PIN -1
#endif //Z_HOME_DIR > 0
#if DISABLED(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
#ifndef Z_PROBE_ENDSTOP // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
#define Z_PROBE_PIN -1
#endif
#if ENABLED(DISABLE_XMAX_ENDSTOP)
#ifdef DISABLE_XMAX_ENDSTOP
#undef X_MAX_PIN
#define X_MAX_PIN -1
#endif
#if ENABLED(DISABLE_XMIN_ENDSTOP)
#ifdef DISABLE_XMIN_ENDSTOP
#undef X_MIN_PIN
#define X_MIN_PIN -1
#endif
#if ENABLED(DISABLE_YMAX_ENDSTOP)
#ifdef DISABLE_YMAX_ENDSTOP
#define Y_MAX_PIN -1
#endif
#if ENABLED(DISABLE_YMIN_ENDSTOP)
#ifdef DISABLE_YMIN_ENDSTOP
#undef Y_MIN_PIN
#define Y_MIN_PIN -1
#endif
#if ENABLED(DISABLE_ZMAX_ENDSTOP)
#ifdef DISABLE_ZMAX_ENDSTOP
#undef Z_MAX_PIN
#define Z_MAX_PIN -1
#endif
#if ENABLED(DISABLE_ZMIN_ENDSTOP)
#ifdef DISABLE_ZMIN_ENDSTOP
#undef Z_MIN_PIN
#define Z_MIN_PIN -1
#endif
......@@ -5049,7 +5049,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define TEMP_3_PIN -1
#endif
#if ENABLED(MKR4)
#ifdef MKR4
#if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and two extruder
#define E0E1_CHOICE_PIN 5
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 3 extruder
......@@ -5067,20 +5067,20 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif //EXTRUDERS
#endif //MKR4
#if ENABLED(NPR2)
#ifdef NPR2
#define E_MIN_PIN -1
#endif //NPR2
#if ENABLED(LASERBEAM)
#ifdef LASERBEAM
#define LASER_PWR_PIN 41
#define LASER_TTL_PIN 42
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#ifdef FILAMENT_RUNOUT_SENSOR
#define FILRUNOUT_PIN -1
#endif
#if ENABLED(FILAMENT_SENSOR)
#ifdef FILAMENT_SENSOR
// FMM added for Filament Extruder
//define analog pin for the filament width sensor input
//Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
......
This diff is collapsed.
......@@ -37,7 +37,7 @@ typedef struct {
long acceleration_rate; // The acceleration rate used for acceleration calculation
unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
unsigned char active_driver; // Selects the active driver
#if ENABLED(ADVANCE)
#ifdef ADVANCE
long advance_rate;
volatile long initial_advance;
volatile long final_advance;
......@@ -60,11 +60,11 @@ typedef struct {
unsigned long final_rate; // The minimal rate at exit
unsigned long acceleration_st; // acceleration steps/sec^2
unsigned long fan_speed;
#if ENABLED(BARICUDA)
#ifdef BARICUDA
unsigned long valve_pressure;
unsigned long e_to_p_pressure;
#endif
#if ENABLED(LASERBEAM)
#ifdef LASERBEAM
unsigned long laser_ttlmodulation;
#endif
volatile char busy;
......@@ -82,7 +82,7 @@ extern volatile unsigned char block_buffer_head;
extern volatile unsigned char block_buffer_tail;
FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); }
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h"
......@@ -132,7 +132,7 @@ extern float max_e_jerk;
extern float mintravelfeedrate;
extern unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS];
#if ENABLED(AUTOTEMP)
#ifdef AUTOTEMP
extern bool autotemp_enabled;
extern float autotemp_max;
extern float autotemp_min;
......
#include "qr_solve.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
#ifdef AUTO_BED_LEVELING_GRID
#include <stdlib.h>
#include <math.h>
......
#include "Configuration.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
#ifdef AUTO_BED_LEVELING_GRID
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy );
......
......@@ -9,24 +9,24 @@
/**
* Dual Stepper Drivers
*/
#if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS)
#if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Y_DUAL_STEPPER_DRIVERS)
#error You cannot have dual stepper drivers for both Y and Z.
#endif
/**
* Progress Bar
*/
#if ENABLED(LCD_PROGRESS_BAR)
#if DISABLED(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
#ifndef SDSUPPORT
#error LCD_PROGRESS_BAR requires SDSUPPORT.
#endif
#if ENABLED(DOGLCD)
#ifdef DOGLCD
#error LCD_PROGRESS_BAR does not apply to graphical displays.
#endif
#if ENABLED(FILAMENT_LCD_DISPLAY)
#ifdef FILAMENT_LCD_DISPLAY
#error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
#endif
#if ENABLED(POWER_CONSUMPTION_LCD_DISPLAY)
#ifdef POWER_CONSUMPTION_LCD_DISPLAY
#error LCD_PROGRESS_BAR and POWER_CONSUMPTION_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
#endif
#endif
......@@ -34,14 +34,14 @@
/**
* Babystepping
*/
#if ENABLED(BABYSTEPPING)
#if ENABLED(COREXY)
#ifdef BABYSTEPPING
#ifdef COREXY
#error BABYSTEPPING not implemented for COREXY yet.
#endif
#if ENABLED(SCARA)
#ifdef SCARA
#error BABYSTEPPING is not implemented for SCARA yet.
#endif
#if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
#if defined(DELTA) && defined(BABYSTEP_XY)
#error BABYSTEPPING only implemented for Z axis on deltabots.
#endif
#endif
......@@ -49,28 +49,28 @@
/**
* Filament Change with Extruder Runout Prevention
*/
#if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
#if defined(FILAMENTCHANGEENABLE) && defined(EXTRUDER_RUNOUT_PREVENT)
#error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE.
#endif
/**
* Extruder Runout Prevention
*/
#if ENABLED(EXTRUDER_RUNOUT_PREVENT) && EXTRUDER_RUNOUT_MINTEMP < EXTRUDE_MINTEMP
#if defined(EXTRUDER_RUNOUT_PREVENT) && EXTRUDER_RUNOUT_MINTEMP < EXTRUDE_MINTEMP
#error EXTRUDER_RUNOUT_MINTEMP have to be greater than EXTRUDE_MINTEMP
#endif
/**
* Idle oozing prevent with Extruder Runout Prevention
*/
#if ENABLED(EXTRUDER_RUNOUT_PREVENT) && defined(IDLE_OOZING_PREVENT)
#if defined(EXTRUDER_RUNOUT_PREVENT) && defined(IDLE_OOZING_PREVENT)
#error EXTRUDER_RUNOUT_PREVENT and IDLE_OOZING_PREVENT are incopatible. Please comment one of them.
#endif
/**
* Idle oozing prevent
*/
#if ENABLED(IDLE_OOZING_PREVENT) && IDLE_OOZING_MINTEMP < EXTRUDE_MINTEMP
#if defined(IDLE_OOZING_PREVENT) && IDLE_OOZING_MINTEMP < EXTRUDE_MINTEMP
#error IDLE_OOZING_MINTEMP have to be greater than EXTRUDE_MINTEMP
#endif
......@@ -83,19 +83,19 @@
#error The maximum number of EXTRUDERS is 4.
#endif
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
#error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
#endif
#if ENABLED(HEATERS_PARALLEL)
#ifdef HEATERS_PARALLEL
#error EXTRUDERS must be 1 with HEATERS_PARALLEL.
#endif
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#ifdef Y_DUAL_STEPPER_DRIVERS
#error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
#endif
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#ifdef Z_DUAL_STEPPER_DRIVERS
#error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS.
#endif
......@@ -111,21 +111,21 @@
/**
* Required LCD language
*/
#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && DISABLED(DISPLAY_CHARSET_HD44780_JAPAN) && DISABLED(DISPLAY_CHARSET_HD44780_WESTERN) && DISABLED(DISPLAY_CHARSET_HD44780_CYRILLIC)
#if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)&& !defined(DISPLAY_CHARSET_HD44780_CYRILLIC)
#error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
#endif
/**
* Auto Bed Leveling
*/
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
/**
* Require a Z Min pin
*/
#if Z_MIN_PIN == -1
#if Z_PROBE_PIN == -1 || (DISABLED(Z_PROBE_ENDSTOP) // It's possible for someone to set a pin for the Z Probe, but not enable it.
#if ENABLED(Z_PROBE_REPEATABILITY_TEST)
#if Z_PROBE_PIN == -1 || defined(Z_PROBE_ENDSTOP) // It's possible for someone to set a pin for the Z Probe, but not enable it.
#ifdef Z_PROBE_REPEATABILITY_TEST
#error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
#else
#error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin.
......@@ -136,7 +136,7 @@
/**
* Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
*/
#if ENABLED(Z_PROBE_ENDSTOP)
#if defined(Z_PROBE_ENDSTOP)
#ifndef Z_PROBE_PIN
#error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP
#endif
......@@ -160,7 +160,7 @@
/**
* Check if Probe_Offset * Grid Points is greater than Probing Range
*/
#if ENABLED(AUTO_BED_LEVELING_GRID)
#ifdef AUTO_BED_LEVELING_GRID
// Make sure probing points are reachable
#if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
......@@ -227,14 +227,14 @@
/**
* ULTIPANEL encoder
*/
#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && DISABLED(SHIFT_CLK)
#if defined(ULTIPANEL) && !defined(NEWPANEL) && !defined(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
#error ULTIPANEL requires some kind of encoder.
#endif
/**
* Delta & Z_PROBE_ENDSTOP
*/
#if ENABLED(DELTA) && ENABLED(Z_PROBE_ENDSTOP)
#if defined(DELTA) && defined(Z_PROBE_ENDSTOP)
#ifndef Z_PROBE_PIN
#error You must have a Z_PROBE_PIN defined in your pins2tool.h file if you enable Z_PROBE_ENDSTOP
#endif
......@@ -246,8 +246,8 @@
/**
* Dual X Carriage requirements
*/
#if ENABLED(DUAL_X_CARRIAGE)
#if EXTRUDERS == 1 || ENABLED(COREXY) \
#ifdef DUAL_X_CARRIAGE
#if EXTRUDERS == 1 || defined(COREXY) \
|| !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
|| !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
|| !HAS_X_MAX
......@@ -288,7 +288,7 @@
#if !HAS_HEATER_2
#error HEATER_2_PIN not defined for this board
#endif
#elif HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
#elif HOTENDS > 1 || defined(HEATERS_PARALLEL)
#if !HAS_HEATER_1
#error HEATER_1_PIN not defined for this board
#endif
......@@ -308,11 +308,11 @@
#error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds
#endif
#if DISABLED(THERMAL_PROTECTION_HOTENDS) && (ENABLED(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
#if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
#error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS
#endif
#if DISABLED(THERMAL_PROTECTION_BED) && ENABLED(THERMAL_PROTECTION_BED_PERIOD)
#if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
#error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED
#endif
......
This diff is collapsed.
......@@ -53,7 +53,7 @@
#define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
#endif //DRIVER_EXTRUDERS
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
extern bool abort_on_endstop_hit;
#endif
......@@ -70,7 +70,7 @@ void st_set_e_position(const long &e);
// Get current position in steps
long st_get_position(uint8_t axis);
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
// Get current position in mm
float st_get_position_mm(AxisEnum axis);
#endif
......@@ -101,18 +101,18 @@ void digipot_current(uint8_t driver, int current);
void microstep_init();
void microstep_readings();
#if ENABLED(Z_DUAL_ENDSTOPS)
#ifdef Z_DUAL_ENDSTOPS
void In_Homing_Process(bool state);
void Lock_z_motor(bool state);
void Lock_z2_motor(bool state);
#endif
#if ENABLED(BABYSTEPPING)
#ifdef BABYSTEPPING
void babystep(const uint8_t axis,const bool direction); // perform a short step with a single stepper motor, outside of any convention
#endif
#if ENABLED(NPR2) // Multiextruder
#ifdef NPR2 // Multiextruder
void colorstep(long csteps,const bool direction);
#endif // NPR2
#endif
#endif // stepper_h
......@@ -22,203 +22,203 @@
#include "stepper_indirection.h"
#include "Configuration.h"
#if ENABLED(HAVE_TMCDRIVER)
#ifdef HAVE_TMCDRIVER
#include <SPI.h>
#include <TMC26XStepper.h>
#endif
// Stepper objects of TMC steppers used
#if ENABLED(X_IS_TMC)
#ifdef X_IS_TMC
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR);
#endif
#if ENABLED(X2_IS_TMC)
#ifdef X2_IS_TMC
TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR);
#endif
#if ENABLED(Y_IS_TMC)
#ifdef Y_IS_TMC
TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR);
#endif
#if ENABLED(Y2_IS_TMC)
#ifdef Y2_IS_TMC
TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR);
#endif
#if ENABLED(Z_IS_TMC)
#ifdef Z_IS_TMC
TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR);
#endif
#if ENABLED(Z2_IS_TMC)
#ifdef Z2_IS_TMC
TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR);
#endif
#if ENABLED(E0_IS_TMC)
#ifdef E0_IS_TMC
TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR);
#endif
#if ENABLED(E1_IS_TMC)
#ifdef E1_IS_TMC
TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR);
#endif
#if ENABLED(E2_IS_TMC)
#ifdef E2_IS_TMC
TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR);
#endif
#if ENABLED(E3_IS_TMC)
#ifdef E3_IS_TMC
TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR);
#endif
#if ENABLED(HAVE_TMCDRIVER)
#ifdef HAVE_TMCDRIVER
void tmc_init()
{
#if ENABLED(X_IS_TMC)
#ifdef X_IS_TMC
stepperX.setMicrosteps(X_MICROSTEPS);
stepperX.start();
#endif
#if ENABLED(X2_IS_TMC)
#endif
#ifdef X2_IS_TMC
stepperX2.setMicrosteps(X2_MICROSTEPS);
stepperX2.start();
#endif
#if ENABLED(Y_IS_TMC)
#endif
#ifdef Y_IS_TMC
stepperY.setMicrosteps(Y_MICROSTEPS);
stepperY.start();
#endif
#if ENABLED(Y2_IS_TMC)
#endif
#ifdef Y2_IS_TMC
stepperY2.setMicrosteps(Y2_MICROSTEPS);
stepperY2.start();
#endif
#if ENABLED(Z_IS_TMC)
#endif
#ifdef Z_IS_TMC
stepperZ.setMicrosteps(Z_MICROSTEPS);
stepperZ.start();
#endif
#if ENABLED(Z2_IS_TMC)
#endif
#ifdef Z2_IS_TMC
stepperZ2.setMicrosteps(Z2_MICROSTEPS);
stepperZ2.start();
#endif
#if ENABLED(E0_IS_TMC)
#endif
#ifdef E0_IS_TMC
stepperE0.setMicrosteps(E0_MICROSTEPS);
stepperE0.start();
#endif
#if ENABLED(E1_IS_TMC)
#endif
#ifdef E1_IS_TMC
stepperE1.setMicrosteps(E1_MICROSTEPS);
stepperE1.start();
#endif
#if ENABLED(E2_IS_TMC)
#endif
#ifdef E2_IS_TMC
stepperE2.setMicrosteps(E2_MICROSTEPS);
stepperE2.start();
#endif
#if ENABLED(E3_IS_TMC)
#endif
#ifdef E3_IS_TMC
stepperE3.setMicrosteps(E3_MICROSTEPS);
stepperE3.start();
#endif
#endif
}
#endif
// L6470 Driver objects and inits
#if ENABLED(HAVE_L6470DRIVER)
#ifdef HAVE_L6470DRIVER
#include <SPI.h>
#include <L6470.h>
#endif
// L6470 Stepper objects
#if ENABLED(X_IS_L6470)
#ifdef X_IS_L6470
L6470 stepperX(X_ENABLE_PIN);
#endif
#if ENABLED(X2_IS_L6470)
#endif
#ifdef X2_IS_L6470
L6470 stepperX2(X2_ENABLE_PIN);
#endif
#if ENABLED(Y_IS_L6470)
#endif
#ifdef Y_IS_L6470
L6470 stepperY(Y_ENABLE_PIN);
#endif
#if ENABLED(Y2_IS_L6470)
#endif
#ifdef Y2_IS_L6470
L6470 stepperY2(Y2_ENABLE_PIN);
#endif
#if ENABLED(Z_IS_L6470)
#endif
#ifdef Z_IS_L6470
L6470 stepperZ(Z_ENABLE_PIN);
#endif
#if ENABLED(Z2_IS_L6470)
#endif
#ifdef Z2_IS_L6470
L6470 stepperZ2(Z2_ENABLE_PIN);
#endif
#if ENABLED(E0_IS_L6470)
#endif
#ifdef E0_IS_L6470
L6470 stepperE0(E0_ENABLE_PIN);
#endif
#if ENABLED(E1_IS_L6470)
#endif
#ifdef E1_IS_L6470
L6470 stepperE1(E1_ENABLE_PIN);
#endif
#if ENABLED(E2_IS_L6470)
#endif
#ifdef E2_IS_L6470
L6470 stepperE2(E2_ENABLE_PIN);
#endif
#if ENABLED(E3_IS_L6470)
#endif
#ifdef E3_IS_L6470
L6470 stepperE3(E3_ENABLE_PIN);
#endif
#endif
// init routine
#if ENABLED(HAVE_L6470DRIVER)
#ifdef HAVE_L6470DRIVER
void L6470_init()
{
#if ENABLED(X_IS_L6470)
#ifdef X_IS_L6470
stepperX.init(X_K_VAL);
stepperX.softFree();
stepperX.setMicroSteps(X_MICROSTEPS);
stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection
stepperX.setStallCurrent(X_STALLCURRENT);
#endif
#if ENABLED(X2_IS_L6470)
#endif
#ifdef X2_IS_L6470
stepperX2.init(X2_K_VAL);
stepperX2.softFree();
stepperX2.setMicroSteps(X2_MICROSTEPS);
stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection
stepperX2.setStallCurrent(X2_STALLCURRENT);
#endif
#if ENABLED(Y_IS_L6470)
#endif
#ifdef Y_IS_L6470
stepperY.init(Y_K_VAL);
stepperY.softFree();
stepperY.setMicroSteps(Y_MICROSTEPS);
stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection
stepperY.setStallCurrent(Y_STALLCURRENT);
#endif
#if ENABLED(Y2_IS_L6470)
#endif
#ifdef Y2_IS_L6470
stepperY2.init(Y2_K_VAL);
stepperY2.softFree();
stepperY2.setMicroSteps(Y2_MICROSTEPS);
stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection
stepperY2.setStallCurrent(Y2_STALLCURRENT);
#endif
#if ENABLED(Z_IS_L6470)
#endif
#ifdef Z_IS_L6470
stepperZ.init(Z_K_VAL);
stepperZ.softFree();
stepperZ.setMicroSteps(Z_MICROSTEPS);
stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection
stepperZ.setStallCurrent(Z_STALLCURRENT);
#endif
#if ENABLED(Z2_IS_L6470)
#endif
#ifdef Z2_IS_L6470
stepperZ2.init(Z2_K_VAL);
stepperZ2.softFree();
stepperZ2.setMicroSteps(Z2_MICROSTEPS);
stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection
stepperZ2.setStallCurrent(Z2_STALLCURRENT);
#endif
#if ENABLED(E0_IS_L6470)
#endif
#ifdef E0_IS_L6470
stepperE0.init(E0_K_VAL);
stepperE0.softFree();
stepperE0.setMicroSteps(E0_MICROSTEPS);
stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection
stepperE0.setStallCurrent(E0_STALLCURRENT);
#endif
#if ENABLED(E1_IS_L6470)
#endif
#ifdef E1_IS_L6470
stepperE1.init(E1_K_VAL);
stepperE1.softFree();
stepperE1.setMicroSteps(E1_MICROSTEPS);
stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection
stepperE1.setStallCurrent(E1_STALLCURRENT);
#endif
#if ENABLED(E2_IS_L6470)
#endif
#ifdef E2_IS_L6470
stepperE2.init(E2_K_VAL);
stepperE2.softFree();
stepperE2.setMicroSteps(E2_MICROSTEPS);
stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection
stepperE2.setStallCurrent(E2_STALLCURRENT);
#endif
#if ENABLED(E3_IS_L6470)
#endif
#ifdef E3_IS_L6470
stepperE3.init(E3_K_VAL);
stepperE3.softFree();
stepperE3.setMicroSteps(E3_MICROSTEPS);
stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection
stepperE3.setStallCurrent(E3_STALLCURRENT);
#endif
#endif
}
#endif
......@@ -22,8 +22,6 @@
#ifndef STEPPER_INDIRECTION_H
#define STEPPER_INDIRECTION_H
#include "macros.h"
// X motor
#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN)
#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE)
......@@ -158,12 +156,12 @@
// Pin redefines for TMC drivers.
// TMC26X drivers have step and dir on normal pins, but everything else via SPI
//////////////////////////////////
#if ENABLED(HAVE_TMCDRIVER)
#ifdef HAVE_TMCDRIVER
#include <SPI.h>
#include <TMC26XStepper.h>
void tmc_init();
#if ENABLED(X_IS_TMC)
#ifdef X_IS_TMC
extern TMC26XStepper stepperX;
#undef X_ENABLE_INIT
#define X_ENABLE_INIT ((void)0)
......@@ -175,7 +173,7 @@
#define X_ENABLE_READ stepperX.isEnabled()
#endif
#if ENABLED(X2_IS_TMC)
#ifdef X2_IS_TMC
extern TMC26XStepper stepperX2;
#undef X2_ENABLE_INIT
#define X2_ENABLE_INIT ((void)0)
......@@ -186,7 +184,7 @@
#undef X2_ENABLE_READ
#define X2_ENABLE_READ stepperX2.isEnabled()
#endif
#if ENABLED(Y_IS_TMC)
#ifdef Y_IS_TMC
extern TMC26XStepper stepperY;
#undef Y_ENABLE_INIT
#define Y_ENABLE_INIT ((void)0)
......@@ -197,7 +195,7 @@
#undef Y_ENABLE_READ
#define Y_ENABLE_READ stepperY.isEnabled()
#endif
#if ENABLED(Y2_IS_TMC)
#ifdef Y2_IS_TMC
extern TMC26XStepper stepperY2;
#undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT ((void)0)
......@@ -208,7 +206,7 @@
#undef Y2_ENABLE_READ
#define Y2_ENABLE_READ stepperY2.isEnabled()
#endif
#if ENABLED(Z_IS_TMC)
#ifdef Z_IS_TMC
extern TMC26XStepper stepperZ;
#undef Z_ENABLE_INIT
#define Z_ENABLE_INIT ((void)0)
......@@ -219,7 +217,7 @@
#undef Z_ENABLE_READ
#define Z_ENABLE_READ stepperZ.isEnabled()
#endif
#if ENABLED(Z2_IS_TMC)
#ifdef Z2_IS_TMC
extern TMC26XStepper stepperZ2;
#undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT ((void)0)
......@@ -230,7 +228,7 @@
#undef Z2_ENABLE_READ
#define Z2_ENABLE_READ stepperZ2.isEnabled()
#endif
#if ENABLED(E0_IS_TMC)
#ifdef E0_IS_TMC
extern TMC26XStepper stepperE0;
#undef E0_ENABLE_INIT
#define E0_ENABLE_INIT ((void)0)
......@@ -241,7 +239,7 @@
#undef E0_ENABLE_READ
#define E0_ENABLE_READ stepperE0.isEnabled()
#endif
#if ENABLED(E1_IS_TMC)
#ifdef E1_IS_TMC
extern TMC26XStepper stepperE1;
#undef E1_ENABLE_INIT
#define E1_ENABLE_INIT ((void)0)
......@@ -252,7 +250,7 @@
#undef E1_ENABLE_READ
#define E1_ENABLE_READ stepperE1.isEnabled()
#endif
#if ENABLED(E2_IS_TMC)
#ifdef E2_IS_TMC
extern TMC26XStepper stepperE2;
#undef E2_ENABLE_INIT
#define E2_ENABLE_INIT ((void)0)
......@@ -263,7 +261,7 @@
#undef E2_ENABLE_READ
#define E2_ENABLE_READ stepperE2.isEnabled()
#endif
#if ENABLED(E3_IS_TMC)
#ifdef E3_IS_TMC
extern TMC26XStepper stepperE3;
#undef E3_ENABLE_INIT
#define E3_ENABLE_INIT ((void)0)
......@@ -281,13 +279,13 @@
// Pin redefines for L6470 drivers.
// L640 drivers have step on normal pins, but dir and everything else via SPI
//////////////////////////////////
#if ENABLED(HAVE_L6470DRIVER)
#ifdef HAVE_L6470DRIVER
#include <SPI.h>
#include <L6470.h>
void L6470_init();
#if ENABLED(X_IS_L6470)
#ifdef X_IS_L6470
extern L6470 stepperX;
#undef X_ENABLE_INIT
#define X_ENABLE_INIT ((void)0)
......@@ -308,7 +306,7 @@
#define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
#endif
#if ENABLED(X2_IS_L6470)
#ifdef X2_IS_L6470
extern L6470 stepperX2;
#undef X2_ENABLE_INIT
#define X2_ENABLE_INIT ((void)0)
......@@ -328,7 +326,7 @@
#undef X2_DIR_READ
#define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR)
#endif
#if ENABLED(Y_IS_L6470)
#ifdef Y_IS_L6470
extern L6470 stepperY;
#undef Y_ENABLE_INIT
#define Y_ENABLE_INIT ((void)0)
......@@ -348,7 +346,7 @@
#undef Y_DIR_READ
#define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
#endif
#if ENABLED(Y2_IS_L6470)
#ifdef Y2_IS_L6470
extern L6470 stepperY2;
#undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT ((void)0)
......@@ -368,7 +366,7 @@
#undef Y2_DIR_READ
#define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR)
#endif
#if ENABLED(Z_IS_L6470)
#ifdef Z_IS_L6470
extern L6470 stepperZ;
#undef Z_ENABLE_INIT
#define Z_ENABLE_INIT ((void)0)
......@@ -388,7 +386,7 @@
#undef Y_DIR_READ
#define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
#endif
#if ENABLED(Z2_IS_L6470)
#ifdef Z2_IS_L6470
extern L6470 stepperZ2;
#undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT ((void)0)
......@@ -408,7 +406,7 @@
#undef Y2_DIR_READ
#define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
#endif
#if ENABLED(E0_IS_L6470)
#ifdef E0_IS_L6470
extern L6470 stepperE0;
#undef E0_ENABLE_INIT
#define E0_ENABLE_INIT ((void)0)
......@@ -428,7 +426,7 @@
#undef E0_DIR_READ
#define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
#endif
#if ENABLED(E1_IS_L6470)
#ifdef E1_IS_L6470
extern L6470 stepperE1;
#undef E1_ENABLE_INIT
#define E1_ENABLE_INIT ((void)0)
......@@ -448,7 +446,7 @@
#undef E1_DIR_READ
#define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
#endif
#if ENABLED(E2_IS_L6470)
#ifdef E2_IS_L6470
extern L6470 stepperE2;
#undef E2_ENABLE_INIT
#define E2_ENABLE_INIT ((void)0)
......@@ -468,7 +466,7 @@
#undef E2_DIR_READ
#define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
#endif
#if ENABLED(E3_IS_L6470)
#ifdef E3_IS_L6470
extern L6470 stepperE3;
#undef E3_ENABLE_INIT
#define E3_ENABLE_INIT ((void)0)
......
This diff is collapsed.
......@@ -50,13 +50,13 @@ void manage_heater(); //it is critical that this is called periodically.
// do not use these routines and variables outside of temperature.cpp
extern int target_temperature[4];
extern float current_temperature[4];
#if ENABLED(SHOW_TEMP_ADC_VALUES)
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[4];
extern int current_temperature_bed_raw;
#endif
extern int target_temperature_bed;
extern float current_temperature_bed;
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
extern float redundant_temperature;
#endif
......@@ -64,7 +64,7 @@ extern float current_temperature_bed;
extern unsigned char soft_pwm_bed;
#endif
#if ENABLED(PIDTEMP)
#ifdef PIDTEMP
extern float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS];
#define PID_PARAM(param, e) param[e] // use macro to point to array value
float scalePID_i(float i);
......@@ -73,11 +73,11 @@ extern float current_temperature_bed;
float unscalePID_d(float d);
#endif
#if ENABLED(PIDTEMPBED)
#ifdef PIDTEMPBED
extern float bedKp,bedKi,bedKd;
#endif
#if ENABLED(BABYSTEPPING)
#ifdef BABYSTEPPING
extern volatile int babystepsTodo[3];
#endif
......@@ -93,7 +93,7 @@ extern float current_temperature_bed;
FORCE_INLINE float degHotend(uint8_t hotend) { return current_temperature[HOTEND_ARG]; }
FORCE_INLINE float degBed() { return current_temperature_bed; }
#if ENABLED(SHOW_TEMP_ADC_VALUES)
#ifdef SHOW_TEMP_ADC_VALUES
FORCE_INLINE float rawHotendTemp(uint8_t hotend) { return current_temperature_raw[HOTEND_ARG]; }
FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; }
#endif
......@@ -101,13 +101,13 @@ FORCE_INLINE float degBed() { return current_temperature_bed; }
FORCE_INLINE float degTargetHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG]; }
FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#ifdef THERMAL_PROTECTION_HOTENDS
void start_watching_heater(int e=0);
#endif
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t hotend) {
target_temperature[HOTEND_ARG] = celsius;
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#ifdef THERMAL_PROTECTION_HOTENDS
start_watching_heater(HOTEND_ARG);
#endif
}
......@@ -152,7 +152,7 @@ void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans();
FORCE_INLINE void autotempShutdown() {
#if ENABLED(AUTOTEMP)
#ifdef AUTOTEMP
if (autotemp_enabled) {
autotemp_enabled = false;
if (degTargetHotend(active_extruder) > autotemp_min)
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
#include "Marlin.h"
#if ENABLED(ULTRA_LCD)
#ifdef ULTRA_LCD
int lcd_strlen(char *s);
int lcd_strlen_P(const char *s);
void lcd_update();
......@@ -15,17 +15,18 @@
void lcd_reset_alert_level();
bool lcd_detected(void);
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus();
#endif
#if ENABLED(DOGLCD) && LCD_CONTRAST >= 0
#if defined(DOGLCD) && LCD_CONTRAST >= 0
extern int lcd_contrast;
void lcd_setcontrast(uint8_t value);
#endif
#if !defined(DELTA) && !defined(Z_SAFE_HOMING) && Z_HOME_DIR < 0
void set_pageShowInfo(int value);
void set_ChangeScreen(boolean state);
#endif
#define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
......@@ -33,10 +34,10 @@
#define LCD_UPDATE_INTERVAL 100
#define LCD_TIMEOUT_TO_STATUS 15000
#if ENABLED(ULTIPANEL)
#ifdef ULTIPANEL
void lcd_buttons_update();
extern volatile uint8_t buttons; //the last checked buttons in a bit array.
#if ENABLED(REPRAPWORLD_KEYPAD)
#ifdef REPRAPWORLD_KEYPAD
extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
#endif
#else
......@@ -65,17 +66,17 @@
void lcd_ignore_click(bool b=true);
#if ENABLED(NEWPANEL)
#ifdef NEWPANEL
#define EN_C BIT(BLEN_C)
#define EN_B BIT(BLEN_B)
#define EN_A BIT(BLEN_A)
#define LCD_CLICKED (buttons&EN_C)
#if ENABLED(BTN_BACK) && BTN_BACK > 0
#if defined(BTN_BACK) && BTN_BACK > 0
#define EN_D BIT(BLEN_D)
#define LCD_BACK_CLICKED (buttons&EN_D)
#endif
#if ENABLED(REPRAPWORLD_KEYPAD)
#ifdef REPRAPWORLD_KEYPAD
#define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3))
#define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2))
#define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1))
......
......@@ -3,7 +3,7 @@
#include "Marlin.h"
#if ENABLED(U8GLIB_ST7920)
#ifdef U8GLIB_ST7920
//set optimization so ARDUINO optimizes this file
#pragma GCC optimize (3)
......
......@@ -3,23 +3,23 @@
#include "language.h"
#if ENABLED(DOGLCD)
#ifdef DOGLCD
#define HARDWARE_CHAR_OUT u8g.print
#else
#define HARDWARE_CHAR_OUT lcd.write
#endif
#if DISABLED(SIMULATE_ROMFONT) && ENABLED(DOGLCD)
#if ENABLED(DISPLAY_CHARSET_ISO10646_1)
#if !(defined( SIMULATE_ROMFONT )) && defined( DOGLCD )
#if defined( DISPLAY_CHARSET_ISO10646_1 )
#define MAPPER_ONE_TO_ONE
#elif ENABLED(DISPLAY_CHARSET_ISO10646_5)
#elif defined( DISPLAY_CHARSET_ISO10646_5 )
#define MAPPER_ONE_TO_ONE
#elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
#elif defined( DISPLAY_CHARSET_ISO10646_KANA )
#define MAPPER_ONE_TO_ONE
#endif
#else // SIMULATE_ROMFONT
#if ENABLED(DISPLAY_CHARSET_HD44780_JAPAN)
#if ENABLED(MAPPER_C2C3)
#if defined( DISPLAY_CHARSET_HD44780_JAPAN )
#if defined( MAPPER_C2C3 )
const PROGMEM uint8_t utf_recode[] =
{ // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is fair for symbols
0x20,0x3f,0xec,0xed,0x3f,0x5c,0x7c,0x3f,0x22,0x63,0x61,0x7f,0x3f,0x3f,0x52,0xb0, // c2a
......@@ -35,7 +35,7 @@
0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xfd,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f // c3b
// n ö ÷ ü
};
#elif ENABLED(MAPPER_E382E383)
#elif defined( MAPPER_E382E383 )
const PROGMEM uint8_t utf_recode[] =
{ // 0 1 2 3 4 5 6 7 8 9 a b c d e f
0x3d,0xb1,0xb1,0xa8,0xb2,0xa9,0xb3,0xaa,0xb4,0xab,0xb5,0xb6,0xb6,0xb7,0xb7,0xb8, // e382a Please test and correct
......@@ -51,12 +51,12 @@
0xec,0xa7,0xa6,0xdd,0xcc,0x3f,0x3f,0x3f,0x3f,0x3f,0xa6,0xa5,0xb0,0xa4,0xa4,0x3f // e383b
// ヰ ヱ ヲ ン フ ? ? ? ? ? ヲ ・ ー ヽ ヽ ?
};
#elif ENABLED(MAPPER_D0D1)
#elif defined( MAPPER_D0D1 )
#error( "Cyrillic on a japanese dsplay makes no sense. There are no matching symbols.");
#endif
#elif ENABLED(DISPLAY_CHARSET_HD44780_WESTERN)
#if ENABLED(MAPPER_C2C3)
#elif defined( DISPLAY_CHARSET_HD44780_WESTERN )
#if defined( MAPPER_C2C3 )
:
const PROGMEM uint8_t utf_recode[] =
{ // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is relative complete.
......@@ -73,7 +73,7 @@
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff // c3b ðñóôõö÷øùúûüýþÿ
// ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
};
#elif ENABLED(MAPPER_D0D1)
#elif defined( MAPPER_D0D1 )
#define MAPPER_D0D1_MOD
const PROGMEM uint8_t utf_recode[] =
{//0 1 2 3 4 5 6 7 8 9 a b c d e f
......@@ -86,12 +86,12 @@
0x70,0x63,0x54,0x79,0xd8,0x78,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad // d19
// p c T y Ф x Ч ч Ш Щ Ъ Ы b Э Ю Я
};
#elif ENABLED(MAPPER_E382E383)
#elif defined( MAPPER_E382E383 )
#error( "Katakana on a western display makes no sense. There are no matching symbols." );
#endif
#elif ENABLED(DISPLAY_CHARSET_HD44780_CYRILLIC)
#if ENABLED(MAPPER_D0D1)
#elif defined( DISPLAY_CHARSET_HD44780_CYRILLIC )
#if defined( MAPPER_D0D1 )
#define MAPPER_D0D1_MOD
// it is a Russian alphabet translation
// except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
......@@ -113,9 +113,9 @@
0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 // Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ
// ш щ ъ ы ь э ю я // 7 Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ
}; // ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ
#elif ENABLED(MAPPER_C2C3)
#elif defined( MAPPER_C2C3 )
#error( "Western languages on a cyrillic display makes no sense. There are no matching symbols." );
#elif ENABLED(MAPPER_E382E383)
#elif defined( MAPPER_E382E383 )
#error( "Katakana on a cyrillic display makes no sense. There are no matching symbols." );
#endif
#else
......@@ -123,12 +123,12 @@
#endif // DISPLAY_CHARSET_HD44780_CYRILLIC
#endif // SIMULATE_ROMFONT
#if ENABLED(MAPPER_NON)
#if defined( MAPPER_NON )
char charset_mapper(char c){
HARDWARE_CHAR_OUT( c );
return 1;
}
#elif ENABLED(MAPPER_C2C3)
#elif defined( MAPPER_C2C3 )
uint8_t utf_hi_char; // UTF-8 high part
bool seen_c2 = false;
char charset_mapper(char c){
......@@ -157,7 +157,7 @@
seen_c2 = false;
return 1;
}
#elif ENABLED(MAPPER_D0D1_MOD)
#elif defined( MAPPER_D0D1_MOD )
uint8_t utf_hi_char; // UTF-8 high part
bool seen_d5 = false;
char charset_mapper(char c){
......@@ -188,7 +188,7 @@
seen_d5 = false;
return 1;
}
#elif ENABLED(MAPPER_D0D1)
#elif defined( MAPPER_D0D1 )
uint8_t utf_hi_char; // UTF-8 high part
bool seen_d5 = false;
char charset_mapper(char c){
......@@ -214,7 +214,7 @@
seen_d5 = false;
return 1;
}
#elif ENABLED(MAPPER_E382E383)
#elif defined( MAPPER_E382E383 )
uint8_t utf_hi_char; // UTF-8 high part
bool seen_e3 = false;
bool seen_82_83 = false;
......
......@@ -19,7 +19,7 @@
#include <math.h>
#include "Marlin.h"
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { }
......
......@@ -19,7 +19,7 @@
#ifndef VECTOR_3_H
#define VECTOR_3_H
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
#ifdef ENABLE_AUTO_BED_LEVELING
class matrix_3x3;
struct vector_3
......
#include "Marlin.h"
#if ENABLED(USE_WATCHDOG)
#ifdef USE_WATCHDOG
#include <avr/wdt.h>
#include "watchdog.h"
......@@ -18,15 +18,15 @@
/// intialise watch dog with a 4 sec interrupt time
void watchdog_init()
{
#if ENABLED(WATCHDOG_RESET_MANUAL)
#ifdef WATCHDOG_RESET_MANUAL
//We enable the watchdog timer, but only for the interrupt.
//Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
wdt_reset();
_WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE);
_WD_CONTROL_REG = _BV(WDIE) | WDTO_4S;
#else
#else
wdt_enable(WDTO_4S);
#endif
#endif
}
/// reset watchdog. MUST be called every 1s after init or avr will reset.
......@@ -40,7 +40,7 @@ void watchdog_reset()
//===========================================================================
// Watchdog timer interrupt, called if main program blocks >1sec and manual reset is enabled.
#if ENABLED(WATCHDOG_RESET_MANUAL)
#ifdef WATCHDOG_RESET_MANUAL
ISR(WDT_vect) {
ECHO_LM(ER, MSG_WATCHDOG_RESET);
kill(PSTR("ERR:Please Reset")); // kill blocks //16 characters so it fits on a 16x2 display
......
......@@ -3,7 +3,7 @@
#include "Marlin.h"
#if ENABLED(USE_WATCHDOG)
#ifdef USE_WATCHDOG
// initialize watch dog with a 1 sec interrupt time
void watchdog_init();
// pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures..
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment